package com.zmn.plat.services.impl.online.service.group;

import com.zmn.plat.model.entity.online.service.group.OnlineServiceGroup;
import com.zmn.plat.model.entity.online.service.group.OnlineServiceGroupQuery;
import com.zmn.plat.persistence.interfaces.online.service.group.OnlineServiceGroupDao;
import com.zmn.plat.services.interfaces.online.service.group.OnlineServiceGroupService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;



@Service
public class OnlineServiceGroupServiceImpl implements OnlineServiceGroupService {

    @Resource
    OnlineServiceGroupDao onlineServiceGroupDao;

    @Override
    public OnlineServiceGroup findByKey(Integer groupId) {
        return onlineServiceGroupDao.findByKey(groupId);
    }

    @Override
    public List<OnlineServiceGroup> listPageByQuery(OnlineServiceGroupQuery query) {
        int count = countByQuery(query);
        query.setTotalCount(count);
        return onlineServiceGroupDao.listPageByQuery(query);
    }

    @Override
    public List<OnlineServiceGroup> listByQuery(OnlineServiceGroupQuery query) {
        return onlineServiceGroupDao.listByQuery(query);
    }

    @Override
    public List<String> listServiceGroupIdByQuery(OnlineServiceGroupQuery query) {
        return onlineServiceGroupDao.listServiceGroupIdByQuery(query);
    }

    @Override
    public List<OnlineServiceGroup> listAll() {
        return onlineServiceGroupDao.listAll();
    }

    @Override
    public Integer countByQuery(OnlineServiceGroupQuery query) {
        return onlineServiceGroupDao.countByQuery(query);
    }
    @Override
    public Integer updateStatusByKey(OnlineServiceGroup onlineServiceGroup) {
        return onlineServiceGroupDao.updateStatusByKey(onlineServiceGroup);
    }

    @Override
    public Integer updateStatusBatchByKey(List<Integer> ids, Integer status, String mcStaffName) {
        return onlineServiceGroupDao.updateBatchStatusByKey(ids, status, mcStaffName);
    }
    @Override
    public Integer updateByKey(OnlineServiceGroup onlineServiceGroup) {
        return onlineServiceGroupDao.updateByKey(onlineServiceGroup);
    }

    @Override
    public Integer insert(OnlineServiceGroup onlineServiceGroup) {
        return onlineServiceGroupDao.insert(onlineServiceGroup);
    }

    @Override
    public Integer deleteByKey(Integer groupId) {
        return onlineServiceGroupDao.deleteByKey(groupId);
    }

}